package charatr04.example;
class Animal17 {
    public void shout() {
        System.out.println("喵喵喵。。。。。");
    }

    class Dog17 extends Animal17 {
        public void shout() {
            System.out.println("汪汪汪。。。。");
        }

        public void eat() {
            System.out.println("吃骨头。。。。");
        }
    }

    public class Example17 {
        public void main(String[] args) {
            Animal17 ai = new Dog17();
            System.out.println("insetanceof 判断ai是否是动物类" + (ai instanceof Animal17));
            System.out.println("insetanceof 判断ai是否是动物类" + (ai instanceof Dog17));
            Animal17 a2 = new Animal17();
            System.out.println("insetanceof 判断ai是否是动物类" + (a2 instanceof Animal17));
            System.out.println("insetanceof 判断ai是否是动物类" + (a2 instanceof Dog17));
        }
    }
}